<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>材料查询统计详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css">
    <style>
        .details ul li {width: 50%;float: left;}
        .layui-table thead th{text-align: left;}
        thead tr th:before {content: ""; color: #e3e3e3; font-size: 12px;}
        .layui-table td{text-indent: 0; font-size: 12px; color: #333;}
        @media screen and (max-width: 1100px) {
            .detaileds{width: 100%;overflow-x: auto;}
            .detaileds table{width: 150%!important;overflow-x: auto;}
            .detaL{width: 30%;padding: 0;}
            .dataR{width: 50%;}
            .details ul li{ width: 50%; float: left;}
            .details ul{margin-top: 0;}
            .layui-table tbody td{text-align: left;padding-left: 0;padding-right: 0;text-indent: 1em;}
            .shousuo a{color: #FFF;}
            .MOVE_footer{text-align: right;}
            .MOVE_footer a{color: #FFF;font-size: 20px;line-height: 30px;
                padding: 10px 20px;background-color: #F5A721;height: 100%;position: absolute;right: 0;}
        }
        .detaileds table{margin-top: 0;}

    </style>
</head>
<body>
<div class="_PC">
    <form class="layui-form layui-form-pane" action="" >
        <button class="layui-btn" type="button" onclick="history.back(-1);"><i class="layui-icon"></i></button>
        <button class="dayin" type="button"  onclick="layuiExport()('.layui-table-main .layui-table')" style="float: right; position: fixed; right: 50px; bottom: 50px; z-index: 999;"></button>
        <div class="engineering"><!--工程信息-->
            <div class="titles">供料单号：F632</div>
            <div class="details">
                <!--<ul>-->
                <!--<li><span class='detaL'>项目名称：</span><span class="dataR">  西三环通讯管道施工 </span></li>-->
                <!--<li><span class='detaL'>状态：</span><span class="dataR">尚未供料</span></li>-->
                <!--<li><span class='detaL'>施工单位：</span><span class="dataR"> 厂北路-郑上路</span></li>-->
                <!--<li><span class='detaL'>供货地址：</span><span class="dataR">郑州市金水路花园路</span></li>-->
                <!--<li><span class='detaL'>供货时间：</span><span class="dataR">2017年7月15日</span></li>-->

                <!--</ul>-->
            </div>
            <div class="detailed">      <!--材料明细-->
                <div class="titles">需求申请单</div>
                <div class="detaileds">
                    <table class="layui-table" id="daochu1">
                        <thead>
                        <tr>
                            <th>供料单号</th>
                            <th>材料名称</th>
                            <th>材料规格</th>
                            <th>供货地址</th>
                            <th>签收时间</th>
                            <th>审批状态</th>
                            <th>审批数量</th>
                            <th>发货数量</th>
                            <th>签收数量</th>
                            <th>原价格</th>
                            <th>审核意见</th>
                            <th>签收意见</th>

                            <!--<th>企业名称</th>-->
                            <!--<th>工程起止点</th>-->
                        </tr>
                        </thead>
                        <tbody>
                        <!--<tr>-->
                        <!--<td>三级钢</td>-->
                        <!--<td>28</td>-->
                        <!--<td>t</td>-->
                        <!---->
                        <!--</tr>-->

                        </tbody>
                    </table>
                </div>



            </div>
            <!--<div class="detailed">      &lt;!&ndash;材料明细&ndash;&gt;-->
            <!--<div class="titles">材料供应单（单号：F635）</div>-->

            <!--<div class="detaileds">-->
            <!--<table class="layui-table">-->
            <!--<colgroup>-->
            <!--<col width="150">-->
            <!--<col width="150">-->
            <!--<col width="150">-->
            <!--<col width="150">-->
            <!--<col width="150">-->
            <!--<col width="150">-->
            <!--<col width="150">-->
            <!--</colgroup>-->
            <!--<thead>-->
            <!--<tr>-->
            <!--<th>材料名称</th>-->
            <!--<th>材料规格</th>-->
            <!--<th>数量</th>-->
            <!--</tr>-->
            <!--</thead>-->
            <!--<tbody>-->
            <!--<tr>-->
            <!--<td>三级钢</td>-->
            <!--<td>28</td>-->
            <!--<td>t</td>-->

            <!--</tr>-->
            <!--<tr>-->
            <!--<td>三级钢</td>-->
            <!--<td>28</td>-->
            <!--<td>t</td>-->

            <!--</tr>-->
            <!--<tr>-->
            <!--<td>三级钢</td>-->
            <!--<td>28</td>-->
            <!--<td>t</td>-->

            <!--</tr>-->

            <!--</tbody>-->
            <!--</table>-->
            <!--</div>-->



            <!--</div>-->

        </div>


    </form>
</div>

<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>

<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date1'      //开始时间
        });
        laydate.render({
            elem: '#date2'  //结束时间
        });

        ajaxs('/api/supply/materialGySelList.do','post',{'type':'b','remark':sessionStorage.rm_Code,'p':getCookie('yanzheng')},function(data) {
            //console.log(data)
            var datas=data.data;
            for(var i=0;i<datas.length;i++){
                if(!datas[i].rm_Num){
                    datas[i].rm_Num='';
                }
                var zhuangtai=sessionStorage.zhuangtai;
                switch (zhuangtai){
                    case '0':
                        zhuangtai='签收完成';
                        break;
                    case '-1':
                        zhuangtai='等待签收';
                        break;
                    case '1':
                        zhuangtai='拒绝签收';
                        break;
                };
                var zhuangtais='';
                if(i==0){                   //页面公共部分 只选择一次渲染
                    $('.titles').html('供料单号：'+datas[i].rm_Code);

                    if(!datas[i].valiName){
                        datas[i].valiName='';
                    }

                    $('.details').append(' <ul>\n' +
                        '                <li><span class=\'detaL\'>项目名称：</span><span class="dataR">'+datas[i].eppName+"("+datas[i].eppStaEnd+")"+'</span></li>\n' +
                        '                <li><span class=\'detaL\'>施工单位：</span><span class="dataR">'+datas[i].compName1+'</span></li>\n' +
                        '                <li><span class=\'detaL\'>审核人：</span><span class="dataR">'+datas[i].valiName+'</span></li>\n' +
                        '                <li><span class=\'detaL\'>签收人：</span><span class="dataR">'+datas[i].recvName+'</span></li>\n' +
                        '                <li><span class=\'detaL\'>签收状态：</span><span class="dataR">'+zhuangtai+'</span></li>\n' +

                        '            </ul>')
                };
                var yijians='';
                switch (datas[i].rValidate){
                    case 0:
                        zhuangtais='审核通过';
                        break;
                    case -1:
                        zhuangtais='等待审核';
                        break;
                    case 1:
                        zhuangtais='审核不通过';
                        break;
                };
                if(datas[i].recvName_Opinion){yijians=datas[i].recvName_Opinion}else{yijians=''};
                $('.detaileds tbody').append(' <tr>\n' +
                    '                        <td>'+datas[i].rm_Code+'</td>\n' +
                    '                        <td>'+datas[i].mat_Name+'</td>\n' +
                    '                        <td>'+datas[i].mat_Spec+'</td>\n' +
                    '                        <td>'+datas[i].r_adr+'</td>\n' +
                    '                        <td>'+datas[i].rm_Time+'</td>\n' +
                    '                        <td>'+zhuangtais+'</td>\n' +
                    '                        <td class="_NUMSR">'+datas[i].fin_Num+'</td>\n' +
                    '                        <td class="_NUMSR">'+datas[i].send_Num+'</td>\n' +
                    '                        <td class="_NUMSR">'+datas[i].rm_Num+'</td>\n' +
                    '                        <td class="_NUMSR">'+datas[i].old_Price+'</td>\n' +
                    '                        <td class="_NUMSR">'+datas[i].reMarks+'</td>\n' +
                    '                        <td class="_NUMSR">'+yijians+'</td>\n' +

                    //                    '                        <td>'+datas[i].compName+'</td>\n' +
//                    '                        <td>'+datas[i].compName+'</td>\n' +
                    '\n' +
                    '                    </tr>')


            }
            $('.dataR').each(function (k,v) {
                if($(v).text()=='undefined'){
                    $(this).text('');
                }
            });
            $('td').each(function (k,v) {
                if($(v).text()=='undefined'){
                    $(this).text('');
                }
            });
        })



    })

</script>
</body>
</html>